﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt.ProjectBZJ
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt.ProjectBZJ;

    public class ProjectBZJ_S_Map : ClassMapping<ProjectBZJ_S>
    {
        public ProjectBZJ_S_Map()
        {
            //映射ID
            Id(x => x.Id, map => {
                map.Length(40);
                map.Column("rec_id");
            });

            Property(x => x.IsValid, map => { 
                map.Column("is_valid"); 
            });
            Property(x => x.CreateDate, map =>
            {
                map.Column("create_date");
            });

            Property(x => x.bzj_remark, map => map.Length(100000));
            Property(x => x.rec_date);
            Property(x => x.bzj_value);
            
            //关联
            ManyToOne(x => x.refProjAndEnt, map =>
            {
                map.Column("pe_id");
            });

            //关联操作员
            ManyToOne(x => x.OPUser, map =>
            {
                map.Column("op_user_id");
            });


            Table("t_finance_bzj_sou");

            //不进行创建
            //SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
